<style lang="scss">
  @import "../../utils/base.scss";
</style>
<template>
  <div id='safeCheck' class="quest_content" style="overflow-y:auto;height:100%;width:100%;">
    <!-- 租户详情 -->
    <template id="safeCheck">
      <div class="qheader" :style="{borderBottom: ifedit ? '0px solid rgb(210,210,210)' : '1px solid rgb(210,210,210)',}">
        <p>基础信息</p>
      </div>
      <div class="gcontent form form_left">
        <Form ref="safeCheck" :label-width="labelWidth" label-position="left" class="form form_left">
          <Row v-if="reqId != null && reqId != ''">
            <Col span="8">
            <FormItem label="工单ID：">
              <Input v-model="reqId" :readonly="readonly" />
            </FormItem>
            </Col>
            <Col span="8"  class="col_left" >
            <FormItem label="订单ID:" >
              <Input  v-model="dataInfo.orderNo" :readonly="readonly"  />
            </FormItem>
            </Col>
          </Row>
          <Row>
            <Col span="8" >
            <FormItem label="提交人姓名:">
              <Input  v-model="dataInfo.linkMan" :readonly="readonly"  />
            </FormItem>
            </Col>
            <Col span="8"  class="col_left" >
            <FormItem label="申请人邮箱:" >
              <Input  v-model="dataInfo.email" :readonly="readonly"  />
            </FormItem>
            </Col>
          </Row>
          <Row>
            <Col span="8">
            <FormItem label="企业名称：" prop="reqSubject">
              <Input v-model="dataInfo.companyName" :readonly="readonly" />
            </FormItem>
            </Col>
          </Row>
          <Row>
            <Col>
            <FormItem label="需求描述：" prop="reqSubject">
              <Input v-model="dataInfo.description" type="textarea" :autosize="{minRows: 4,maxRows: 6}" style="width:96%" :readonly="readonly" />
            </FormItem>
            </Col>
          </Row>
        </Form>
      </div>
      <div class="qheader" :style="{borderBottom: ifedit ? '0px solid rgb(210,210,210)' : '1px solid rgb(210,210,210)',}">
        <p>订购内容</p>
      </div>
      <div class="gcontent form form_left">
        <template v-for="(item, index) in dataInfo.apiInfo">
          <Row style="padding-top: 15px">
            <Col span="8" >
            <Icon v-if="!item.open" type="ios-arrow-dropdown" size="20" style="cursor:pointer;" @click="openInfo(index)" />
            <Icon v-if="item.open" type="ios-arrow-dropup" size="20" style="cursor:pointer;" @click="openInfo(index)" />
            <span style="margin: 4px;">{{item.apiName}}</span>
            </Col>
          </Row>
          <Row style="padding-top: 15px;margin: 0 15px;" v-if="item.open">
            <div >
              <Form :label-width="labelWidth" label-position="left" class="form " style="margin: 8px;">
                <Row>
                  <Col span="8">
                  <FormItem label="意向能力：">
                    <Input v-model="item.apiName" :readonly="true" />
                  </FormItem>
                  </Col>
                </Row>
                <Row>
                  <Col span="22" style="width:96.666667%">
                  <FormItem label="意向服务：">
                    <template v-for="i in item.interfaceInfo">
                      <Icon type="md-pricetag" size="16" /> {{i.interfaceName}}
                    </template>
                  </FormItem>
                  </Col>
                </Row>
              </Form>
            </div>
          </Row>
        </template>
      </div>

    </template>

  </div>
</template>
<script>
  export default {
    name: "apply",
    components: {
    },
    data() {
      return {
        readonly: true,
        labelWidth: 140,


      }
    },
    created: function() {},
    mounted: function() {

    },

    methods: {
      openInfo(index) {
        if (this.dataInfo.apiInfo[index].open) {
          this.$set(this.dataInfo.apiInfo[index], "open", false)
        } else {
          this.$set(this.dataInfo.apiInfo[index], "open", true)
        }
      },
      getHandleUserParams(opOptions) {
        var param = {}
        if (opOptions != "") {
          param.vari = opOptions
        }
        return param
      },
      getHandleParams(handleInfo){
        handleInfo.isEdit = this.isEdit;
        handleInfo.isChangeContent = 0;
      }
    },
    props: {
      isEdit: {},
      ifedit: {
        type: Boolean,
        default: false,
      },
      reqId: {
        default: null
      },
      processInfo: {},
    },
    computed: {
    	dataInfo(){
        console.log("this.processInfo ---> ", this.processInfo)
        return this.processInfo.content
      }
    }

  }
</script>
